#! /usr/bin/env python

##  Cate - Copyright (C) 2006 - Marco Bubke
##  This program is free software; you can redistribute it and/or modify
##  it under the terms of the GNU General Public License as published by
##  the Free Software Foundation; either version 2, or (at your option)
##  any later version.
##  
##  This program is distributed in the hope that it will be useful,
##  but WITHOUT ANY WARRANTY; without even the implied warranty of
##  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
##  GNU General Public License for more details.

import sys
from PyQt4 import QtGui, QtOpenGL
import mainwindow
from OpenGL import GL, constant

import icons_rc

app = QtGui.QApplication(sys.argv)

if not QtOpenGL.QGLFormat.hasOpenGL():
  QtGui.QMessageBox.critical(None, "Cate", 
    "Your system has no OpenGL support!", 
    QtGui.QMessageBox.Ok | QtGui.QMessageBox.Default,
    QtGui.QMessageBox.NoButton)
  sys.exit(1)

main = mainwindow.MainWindow()

app.setWindowIcon(QtGui.QIcon(':/icons/cate.png'))


main.show()

print GL.glGetString(GL.constants.GL_VENDOR)
print GL.glGetString(GL.constants.GL_RENDERER)
print GL.glGetString(GL.constants.GL_VERSION)
##print GL.glGetString(GL.constants.GL_EXTENSIONS)


sys.exit(app.exec_())
